package vn.edu.saigontech.ncms.web.offering;

import vn.edu.saigontech.ncms.model.info.Offering;
import vn.edu.saigontech.ncms.service.OfferingService;
import vn.edu.saigontech.ncms.util.DateUtil;
import vn.edu.saigontech.ncms.web.BaseAction;

@SuppressWarnings("serial")
public class TeachingAttendanceAction extends BaseAction {

	private Long offeringId;
	private String fromDate;
	private String toDate;

	public String showMakeForm() {
		this.fromDate = DateUtil.toString(DateUtil.get26OfLastMonth(DateUtil
				.newDate()), this.i18n("format.date"));
		this.toDate = DateUtil.toString(DateUtil.get26OfThisMonth(DateUtil
				.newDate()), this.i18n("format.date"));
		Offering offering = OfferingService.INSTANCE.findById(this.offeringId);
		REQUEST().setAttribute("offering", offering);
		return SUCCESS;
	}

	public String makeForm() {
		Offering offering = OfferingService.INSTANCE.findById(this.offeringId);
		REQUEST().setAttribute("offering", offering);
		return SUCCESS;
	}

	public Long getOfferingId() {
		return offeringId;
	}

	public void setOfferingId(Long offeringId) {
		this.offeringId = offeringId;
	}

	public String getFromDate() {
		return fromDate;
	}

	public void setFromDate(String fromDate) {
		this.fromDate = fromDate;
	}

	public String getToDate() {
		return toDate;
	}

	public void setToDate(String toDate) {
		this.toDate = toDate;
	}

}
